const crypto = require('crypto')
const uuid = require('uuid/v4')

module.exports = {
  md5(n) {
    // md5加密
    let hash = crypto.createHash('md5')
    hash.update(n)
    // hex 10进制
    return hash.digest('hex')
  },
  createId() {
    return uuid().replace(/\-/g, '')
  }
}
